<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        // 数字字母混合6位验证码  
        //    随机在字符串中取六次
        var str = '1234567890qwertyuiopasdfghjklzxcvbnm'
        // console.log(str.length - 1);
        // 0-35 之间的数字，作为 字符串的下标
        var res = ''
        var arr = []
        for (var i = 0; i < 6; i++) {
            var n = parseInt(Math.random() * str.length)
            // console.log(str[n]);

            //随机取出来的字符 累加到 res上
            res += str[n];
            arr.push(str[n])

        }
        console.log(res);
        console.log(arr);
        console.log(arr.join(''));
    </script>

    <script src="./common.js"></script>
    <script>
        // var r = randomCode(10);
        var r = randomCode();
        console.log(r);
    </script>

</body>

</html>